//
//  YMCaseView.swift
//  YMSwiftUI
//
//  Created by anscen on 2022/4/27.
//

import UIKit

class YMCaseView: UIView {
    @IBOutlet weak var imageV: UIImageView!
    @IBOutlet weak var titleLab: UILabel!
    
    @IBOutlet weak var subTitleLab: UILabel!
    @IBOutlet weak var contentLab: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.imageV.layer.masksToBounds = true
        self.imageV.layer.cornerRadius = 5
    }
    var model :YMBook?{
        didSet{
            guard let item = model else { return }
            self.imageV.image = UIImage.imageWithColor(color: UIColor(hex: "999999"))
            self.titleLab.text = item.title ?? ""
            self.subTitleLab.text = item.author ?? ""
            self.contentLab.text = item.shortIntro
        }
    }
}
